package com.wiscamp.ninechapters.problems.infrastructure.mappers.sets;

import com.wiscamp.ninechapters.problems.infrastructure.po.sets.KnowledgePointRulePO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.Collection;

/**
 * 组题规则-知识点规则仓储对象
 *
 * @author yifeng
 */
@Repository
public interface KnowledgePointRuleMapper extends JpaRepository<KnowledgePointRulePO, Long>, JpaSpecificationExecutor<KnowledgePointRulePO> {
    @Query(value = "select e from KnowledgePointRulePO e where e.ruleId = :ruleId")
    Collection<KnowledgePointRulePO> findKnowledgePointRules(long ruleId);
}